/**
 * 
 */
include('datahora.js');
include('relogio.js');
include('numero.js');
include('popup.js');
include('cliente.js');
include('atendimento.js');
include('usuario.js');
include('servico.js');
include('habilitacao.js');

function include(url) {
	  window.document.write('<script src="/sga/js/'+url+'" language="JavaScript" type="text/javascript"></script>');
	}


function proximoFocus(Idcampo,IdproximoCampo){
	var campo = document.getElementById(Idcampo);
	if (campo.value.length == campo.maxLength){
		document.getElementById(IdproximoCampo).value="";
		document.getElementById(IdproximoCampo).focus();
	}

}

function descanso(){
	
	window.location.href ='/sga/index.jsp';
}

function getfocus(elemento){
    document.getElementById(elemento).focus();
}


function setHref(elemento,value){
	elemento.setAttribute("href","");
	elemento.setAttribute("href",value);
}


function setElementValueById(ElementId,value){
	document.getElementById(ElementId).value=value;
}

function submitForm(FormId){
	document.getElementById(FormId).submit();
}

function apagaTextoById(id) {
	document.getElementById(id).value='';
	
}

function apagaRadio(name,length) {
	var radio=document.getElementsByName(name);
	for(var i=0;i<length;i++)
	radio[i].checked=false;
	
	
}

function apagaLoginOnFocus() {
	campo=document.getElementById('login');
	if(campo.value=='Login'){
		
		campo.value='';
	}
}

function preencheLoginOnBlur() {
	campo=document.getElementById('login');
	if(campo.value==''){
		
		
		campo.value='Login';
	}
}

function apagaSenhaOnFocus() {
	campo=document.getElementById('senha');
	
	if (campo.value=='Senha'){
		campo.type='password';
		campo.value='';
	}
}

function preencheSenhaOnBlur() {
	campo=document.getElementById('senha');
	
	if(campo.value==''){
		campo.type='text';
		campo.value='Senha';
	}
	
}